﻿using DevExpress.Utils;
using DevExpress.XtraBars.Docking;
using DevExpress.XtraBars.Docking.Helpers;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Container;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Repository;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTab;
using DevExpress.XtraTreeList;
using DevExpress.XtraTreeList.Columns;
using DevExpress.XtraTreeList.Nodes;
using HuaWei.CommClass;
using HuaWei.CommComp;
using HuaWei.Common;
using HuaWei.DAI;
using HuaWei.EI;
using HuaWei.Windows.Forms;
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

namespace HuaWei
{
    public class FrmBGL : FrmBase
    {
        private string _str2;
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private BindingSource bindingSource2;
        private BindingSource bindingSource3;
        private BindingSource bindingSource4;
        private SimpleButton btnCopy;
        private SimpleButton btnDel;
        private SimpleButton btnExport;
        private SimpleButton btnNew;
        private SimpleButton btnSDBZ;
        private ButtonEdit buttonEdit;
        private CheckEdit ceTYSB;
        private GridColumn colBBWBGHTZSL;
        private GridColumn colBGZJL;
        private GridColumn colbl;
        private GridColumn colBQJLS;
        private TreeListColumn colCBMC;
        private GridColumn colDW;
        private TreeListColumn colID;
        private GridColumn colMC;
        private GridColumn colQDBH;
        private TreeListColumn colQDBH1;
        private GridColumn colXMMC;
        private DockManager dockManager;
        private DockPanel dockPanel1;
        private ControlContainer dockPanel1_Container;
        private TextEdit edtBGLH;
        private DateEdit edtBGLRQ;
        private GridColumn gridColumn;
        private GridColumn gridColumn1;
        private GridColumn gridColumn2;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridControl gridControl;
        private GridControl gridControl1;
        private GridControl gridControl2;
        private GridControl gridControl3;
        private GridView gridView1;
        private GridView gridView2;
        private GridView gridView3;
        private GridView gridView4;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private IContainer icontainer1;
        private TextEdit kidQzxrya7;
        private LabelControl labelControl1;
        private LabelControl labelControl10;
        private LabelControl labelControl11;
        private LabelControl labelControl12;
        private LabelControl labelControl13;
        private LabelControl labelControl14;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;
        private LabelControl labelControl7;
        private LabelControl labelControl8;
        private LabelControl labelControl9;
        private MemoEdit memoEdit1;
        private PanelControl panelControl1;
        private PanelControl panelControl3;
        private PanelControl panelControl4;
        private PanelControl panelControl5;
        private PanelControl panelControl6;
        private PanelControl panelControl7;
        private RadioGroup radioGroup;
        private RepositoryItemImageComboBox repositoryItemImageComboBox2;
        private SimpleButton simpleButton;
        private SplitterControl splitterControl1;
        private SplitterControl splitterControl2;
        private SplitterControl splitterControl3;
        private TextEdit textEdit;
        private TextEdit textEdit1;
        private TextEdit textEdit10;
        private TextEdit textEdit2;
        private TextEdit textEdit3;
        private TextEdit textEdit4;
        private TextEdit textEdit5;
        private TextEdit textEdit6;
        private TextEdit textEdit7;
        private TextEdit textEdit8;
        private TextEdit textEdit9;
        private TreeList trJLQD;
        private LabelControl XDSLSFKWM;
        private XtraTabControl xtraTabControl;
        private XtraTabPage xtraTabPage1;
        private XtraTabPage xtraTabPage2;
        public dataSets1 dataSets;

        public FrmBGL()
        {
            this.InitializeComponent();
            this.xtraTabControl.ShowTabHeader = DefaultBoolean.False;
            DevCCHelp.SetGridButton(this.gridControl);
        }

        private void bindingSource1_PositionChanged(object sender, EventArgs e)
        {
            string objValue = DHelp.GetObjValue(this.bindingSource1, "qdid", false);
            this.bindingSource.Filter = string.Concat("qdid='", objValue, "'");
        }

        private void bindingSource2_PositionChanged(object sender, EventArgs e)
        {
            DataRow row = null;
            BindingSource bindingSources = sender as BindingSource;
            if (bindingSources.Current != null)
            {
                row = (bindingSources.Current as DataRowView).Row;
            }
            this.lquywmUul(row);
            this.method8(row);
            this.method6(false);
        }

        private void btnCopy_Click(object sender, EventArgs e)
        {
            this.method15();
        }

        private void btnDel_Click(object sender, EventArgs e)
        {
            this.method12();
        }

        private void btnExport_Click(object sender, EventArgs e)
        {
            Class37.smethod1().YZExpBGLData();
            this.method1();
        }

        private void btnNew_Click(object sender, EventArgs e)
        {
            this.method9();
        }

        private void btnSDBZ_Click(object sender, EventArgs e)
        {
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource2);
            if (dataRow != null)
            {
                string str = string.Format("select * from REFBGL where bglid='{0}'", dataRow["id"].ToString());
                DataTable dt = DBHelp.GetDt(str, "temp");
                string str1 = "";
                foreach (DataRow row in dt.Rows)
                {
                    if (!str1.Equals(""))
                    {
                        str1 = string.Concat(str1, "、");
                    }
                    str1 = string.Concat(str1, "第", row["qcid"].ToString(), "期");
                }
                if (!str1.Equals(""))
                {
                    if (MsgBox.ShowQuestion(string.Concat("若解锁此变更令，由于数据改变，对应的【", str1, "】计量数据也相应发生改变，在修改完被解锁的变更令后，需及时将以上几期的计量数据及时重新导出，以便各岗位重新接收。\n\n您确定解锁吗?")) == DialogResult.OK)
                    {
                        dataRow["SDBZ"] = 0;
                        dataRow["TYSB"] = 0;
                        dataRow.EndEdit();
                        this.btnSDBZ.Enabled = false;
                    }
                }
                else if (MsgBox.ShowQuestion("是否解锁此变更令？") == DialogResult.OK)
                {
                    dataRow["SDBZ"] = 0;
                    dataRow["TYSB"] = 0;
                    dataRow.EndEdit();
                    this.btnSDBZ.Enabled = false;
                }
            }
        }

        private void buttonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            this.buttonEdit.Text = "";
            this.method16();
        }

        private void buttonEdit_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.method16();
            }
        }

        private void ceTYSB_EditValueChanging(object sender, ChangingEventArgs e)
        {
            if (!e.NewValue.Equals(1))
            {
                DevCCHelp.ControlForm(base.Controls, false, 1);
            }
            else if (this.Check())
            {
                DevCCHelp.ControlForm(base.Controls, true, 1);
            }
            else
            {
                e.Cancel = true;
            }
        }

        public override bool Check()
        {
            bool flag;
            if (this.edtBGLRQ.Text.Equals(""))
            {
                MsgBox.ShowMsg("签发日期不能为空，请修正后继续！");
                this.edtBGLRQ.Focus();
                flag = false;
            }
            else if (!this.edtBGLH.Text.Equals(""))
            {
                string objId = DHelp.GetObjId(this.bindingSource2);
                string str = string.Format("BDID='{0}' and id <> '{1}'", GParams._BDID, objId);
                if (DBHelp.Unique("BGL", "BGLH", this.edtBGLH.Text, str))
                {
                    MsgBox.ShowMsg("当前变更令号已经存在，请修正后继续！");
                    this.edtBGLH.Focus();
                    flag = false;
                }
                else if (!this.bindingSource1.List.Count.Equals(0))
                {
                    foreach (DataRowView list in this.bindingSource1.List as DataView)
                    {
                        string str1 = list.Row["BGZJJE"].ToString();
                        if ((str1.Equals("0") ? false : !str1.Equals("")))
                        {
                            continue;
                        }
                        MsgBox.ShowMsg("变更令清单的[变更增减金额]不能为零，请修正后继续！");
                        flag = false;
                        return flag;
                    }
                    flag = true;
                }
                else
                {
                    MsgBox.ShowMsg("当前变更令没有清单，请修正后继续！");
                    flag = false;
                }
            }
            else
            {
                MsgBox.ShowMsg("变更令号不能为空，请修正后继续！");
                this.edtBGLH.Focus();
                flag = false;
            }
            return flag;
        }

        public override void ControlFormStatus()
        {
            if (this.bindingSource2.List.Count == 0)
            {
                DevCCHelp.ControlForm(base.Controls, true, 1);
            }
            else if (!DHelp.GetObjValue(this.bindingSource2, "SDBZ", false).Equals("1"))
            {
                string objValue = DHelp.GetObjValue(this.bindingSource2, "TYSB", false);
                if ((objValue.Equals("0") ? false : !objValue.Equals("")))
                {
                    DevCCHelp.ControlForm(base.Controls, true, 1);
                }
                else
                {
                    DevCCHelp.ControlForm(base.Controls, false, 1);
                }
            }
            else
            {
                DevCCHelp.ControlForm(base.Controls, true, 2);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if ((!disposing ? false : this.icontainer1 != null))
            {
                this.icontainer1.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmBGL_Load(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void gridControl3_DoubleClick(object sender, EventArgs e)
        {
            this.buttonEdit.Text = DHelp.GetObjValue(this.bindingSource4, "qdbh", false);
            this.method16();
        }

        private void InitializeComponent()
        {
            this.icontainer1 = new Container();
            GridLevelNode node = new GridLevelNode();
            this.bindingSource = new BindingSource(this.icontainer1);
            this.bindingSource2 = new BindingSource(this.icontainer1);
            this.bindingSource1 = new BindingSource(this.icontainer1);
            this.gridControl = new GridControl();
            this.gridView2 = new GridView();
            this.colQDBH = new GridColumn();
            this.colXMMC = new GridColumn();
            this.colDW = new GridColumn();
            this.colBQJLS = new GridColumn();
            this.gridColumn = new GridColumn();
            this.colBBWBGHTZSL = new GridColumn();
            this.colBGZJL = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.groupControl1 = new GroupControl();
            this.memoEdit1 = new MemoEdit();
            this.panelControl4 = new PanelControl();
            this.kidQzxrya7 = new TextEdit();
            this.textEdit2 = new TextEdit();
            this.labelControl14 = new LabelControl();
            this.labelControl12 = new LabelControl();
            this.ceTYSB = new CheckEdit();
            this.edtBGLRQ = new DateEdit();
            this.labelControl13 = new LabelControl();
            this.textEdit7 = new TextEdit();
            this.labelControl8 = new LabelControl();
            this.textEdit6 = new TextEdit();
            this.labelControl6 = new LabelControl();
            this.textEdit1 = new TextEdit();
            this.labelControl5 = new LabelControl();
            this.textEdit5 = new TextEdit();
            this.textEdit4 = new TextEdit();
            this.textEdit3 = new TextEdit();
            this.labelControl4 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.XDSLSFKWM = new LabelControl();
            this.labelControl1 = new LabelControl();
            this.edtBGLH = new TextEdit();
            this.panelControl3 = new PanelControl();
            this.btnExport = new SimpleButton();
            this.btnSDBZ = new SimpleButton();
            this.btnDel = new SimpleButton();
            this.btnCopy = new SimpleButton();
            this.btnNew = new SimpleButton();
            this.buttonEdit = new ButtonEdit();
            this.bindingSource3 = new BindingSource(this.icontainer1);
            this.panelControl6 = new PanelControl();
            this.panelControl5 = new PanelControl();
            this.splitterControl3 = new SplitterControl();
            this.splitterControl2 = new SplitterControl();
            this.groupControl2 = new GroupControl();
            this.gridControl1 = new GridControl();
            this.gridView1 = new GridView();
            this.colMC = new GridColumn();
            this.gridColumn5 = new GridColumn();
            this.colbl = new GridColumn();
            this.panelControl1 = new PanelControl();
            this.labelControl11 = new LabelControl();
            this.textEdit = new TextEdit();
            this.labelControl10 = new LabelControl();
            this.textEdit10 = new TextEdit();
            this.labelControl9 = new LabelControl();
            this.labelControl7 = new LabelControl();
            this.textEdit9 = new TextEdit();
            this.textEdit8 = new TextEdit();
            this.splitterControl1 = new SplitterControl();
            this.gridControl2 = new GridControl();
            this.gridView3 = new GridView();
            this.gridColumn1 = new GridColumn();
            this.dockManager = new DockManager(this.icontainer1);
            this.dockPanel1 = new DockPanel();
            this.dockPanel1_Container = new ControlContainer();
            this.xtraTabControl = new XtraTabControl();
            this.xtraTabPage1 = new XtraTabPage();
            this.gridControl3 = new GridControl();
            this.bindingSource4 = new BindingSource(this.icontainer1);
            this.gridView4 = new GridView();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.xtraTabPage2 = new XtraTabPage();
            this.trJLQD = new TreeList();
            this.colQDBH1 = new TreeListColumn();
            this.colCBMC = new TreeListColumn();
            this.colID = new TreeListColumn();
            this.repositoryItemImageComboBox2 = new RepositoryItemImageComboBox();
            this.panelControl7 = new PanelControl();
            this.radioGroup = new RadioGroup();
            this.simpleButton = new SimpleButton();
            base.ds.BeginInit();
            base.dsQuery.BeginInit();
            base.dataSets.BeginInit();
            ((ISupportInitialize)this.bindingSource).BeginInit();
            ((ISupportInitialize)this.bindingSource2).BeginInit();
            ((ISupportInitialize)this.bindingSource1).BeginInit();
            this.gridControl.BeginInit();
            this.gridView2.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.memoEdit1.Properties.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            this.kidQzxrya7.Properties.BeginInit();
            this.textEdit2.Properties.BeginInit();
            this.ceTYSB.Properties.BeginInit();
            this.edtBGLRQ.Properties.VistaTimeProperties.BeginInit();
            this.edtBGLRQ.Properties.BeginInit();
            this.textEdit7.Properties.BeginInit();
            this.textEdit6.Properties.BeginInit();
            this.textEdit1.Properties.BeginInit();
            this.textEdit5.Properties.BeginInit();
            this.textEdit4.Properties.BeginInit();
            this.textEdit3.Properties.BeginInit();
            this.edtBGLH.Properties.BeginInit();
            this.panelControl3.BeginInit();
            this.panelControl3.SuspendLayout();
            this.buttonEdit.Properties.BeginInit();
            ((ISupportInitialize)this.bindingSource3).BeginInit();
            this.panelControl6.BeginInit();
            this.panelControl5.BeginInit();
            this.panelControl5.SuspendLayout();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.gridControl1.BeginInit();
            this.gridView1.BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.textEdit.Properties.BeginInit();
            this.textEdit10.Properties.BeginInit();
            this.textEdit9.Properties.BeginInit();
            this.textEdit8.Properties.BeginInit();
            this.gridControl2.BeginInit();
            this.gridView3.BeginInit();
            this.dockManager.BeginInit();
            this.dockPanel1.SuspendLayout();
            this.dockPanel1_Container.SuspendLayout();
            this.xtraTabControl.BeginInit();
            this.xtraTabControl.SuspendLayout();
            this.xtraTabPage1.SuspendLayout();
            this.gridControl3.BeginInit();
            ((ISupportInitialize)this.bindingSource4).BeginInit();
            this.gridView4.BeginInit();
            this.xtraTabPage2.SuspendLayout();
            this.trJLQD.BeginInit();
            this.repositoryItemImageComboBox2.BeginInit();
            this.panelControl7.BeginInit();
            this.panelControl7.SuspendLayout();
            this.radioGroup.Properties.BeginInit();
            base.SuspendLayout();
            this.bindingSource.DataMember = "BGLList";
            this.bindingSource2.DataMember = "BGL";
            this.bindingSource2.DataSource = base.dataSets;
            this.bindingSource1.DataMember = "BGLQD";
            this.bindingSource1.DataSource = base.dataSets;
            this.bindingSource1.PositionChanged += new EventHandler(this.bindingSource1_PositionChanged);
            this.gridControl.DataSource = this.bindingSource1;
            this.gridControl.Dock = DockStyle.Fill;
            this.gridControl.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl.EmbeddedNavigator.CustomButtons.AddRange(new NavigatorCustomButton[] { new NavigatorCustomButton(-1, 6, true, true, "", "Add"), new NavigatorCustomButton(-1, 7, true, true, "", "Del") });
            this.gridControl.EmbeddedNavigator.TextLocation = NavigatorButtonsTextLocation.None;
            this.gridControl.EmbeddedNavigator.ButtonClick += new NavigatorButtonClickEventHandler(this.method17);
            this.gridControl.Location = new Point(121, 281);
            this.gridControl.MainView = this.gridView2;
            this.gridControl.Name = "gridBGLQDMX";
            this.gridControl.Size = new Size(603, 241);
            this.gridControl.TabIndex = 14;
            this.gridControl.UseEmbeddedNavigator = true;
            this.gridControl.ViewCollection.AddRange(new BaseView[] { this.gridView2 });
            this.gridView2.Columns.AddRange(new GridColumn[] { this.colQDBH, this.colXMMC, this.colDW, this.colBQJLS, this.gridColumn, this.colBBWBGHTZSL, this.colBGZJL, this.gridColumn4 });
            this.gridView2.GridControl = this.gridControl;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowGroup = false;
            this.gridView2.OptionsCustomization.AllowSort = false;
            this.gridView2.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridView2.OptionsView.ShowIndicator = false;
            this.gridView2.DoubleClick += new EventHandler(this.vroAaJyIa);
            this.colQDBH.Caption = "清单编号";
            this.colQDBH.FieldName = "QDBH";
            this.colQDBH.Name = "colQDBH";
            this.colQDBH.OptionsColumn.AllowEdit = false;
            this.colQDBH.OptionsColumn.ReadOnly = true;
            this.colQDBH.Tag = "-3";
            this.colQDBH.Visible = true;
            this.colQDBH.VisibleIndex = 0;
            this.colQDBH.Width = 58;
            this.colXMMC.Caption = "项目名称";
            this.colXMMC.FieldName = "QDMC";
            this.colXMMC.Name = "colXMMC";
            this.colXMMC.OptionsColumn.AllowEdit = false;
            this.colXMMC.OptionsColumn.ReadOnly = true;
            this.colXMMC.Tag = "-3";
            this.colXMMC.Visible = true;
            this.colXMMC.VisibleIndex = 1;
            this.colXMMC.Width = 198;
            this.colDW.Caption = "单位";
            this.colDW.FieldName = "DW";
            this.colDW.Name = "colDW";
            this.colDW.OptionsColumn.AllowEdit = false;
            this.colDW.OptionsColumn.ReadOnly = true;
            this.colDW.Tag = "-3";
            this.colDW.Visible = true;
            this.colDW.VisibleIndex = 2;
            this.colDW.Width = 35;
            this.colBQJLS.Caption = "单价";
            this.colBQJLS.FieldName = "DJ";
            this.colBQJLS.Name = "colBQJLS";
            this.colBQJLS.OptionsColumn.ReadOnly = true;
            this.colBQJLS.Tag = "-3";
            this.colBQJLS.Visible = true;
            this.colBQJLS.VisibleIndex = 3;
            this.colBQJLS.Width = 52;
            this.gridColumn.Caption = "原图纸数";
            this.gridColumn.FieldName = "BBWYTZSL";
            this.gridColumn.Name = "colBBWYTZSL";
            this.gridColumn.Visible = true;
            this.gridColumn.VisibleIndex = 4;
            this.gridColumn.Width = 62;
            this.colBBWBGHTZSL.Caption = "变后图纸数";
            this.colBBWBGHTZSL.FieldName = "BBWBGHTZSL";
            this.colBBWBGHTZSL.Name = "colBBWBGHTZSL";
            this.colBBWBGHTZSL.Visible = true;
            this.colBBWBGHTZSL.VisibleIndex = 5;
            this.colBBWBGHTZSL.Width = 71;
            this.colBGZJL.Caption = "增减数";
            this.colBGZJL.FieldName = "BGZJL";
            this.colBGZJL.Name = "colBGZJL";
            this.colBGZJL.OptionsColumn.ReadOnly = true;
            this.colBGZJL.Tag = "-3";
            this.colBGZJL.Visible = true;
            this.colBGZJL.VisibleIndex = 6;
            this.colBGZJL.Width = 64;
            this.gridColumn4.Caption = "增减金额";
            this.gridColumn4.DisplayFormat.FormatString = "0";
            this.gridColumn4.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn4.FieldName = "BGZJJE";
            this.gridColumn4.Name = "colBGZJJE";
            this.gridColumn4.OptionsColumn.ReadOnly = true;
            this.gridColumn4.Tag = "-3";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 7;
            this.gridColumn4.Width = 59;
            this.groupControl1.Controls.Add(this.memoEdit1);
            this.groupControl1.Dock = DockStyle.Top;
            this.groupControl1.Location = new Point(121, 149);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(603, 126);
            this.groupControl1.TabIndex = 15;
            this.groupControl1.Text = "变更令内容";
            this.memoEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGLNR", true));
            this.memoEdit1.Dock = DockStyle.Fill;
            this.memoEdit1.Location = new Point(2, 23);
            this.memoEdit1.Name = "memoEdit1";
            this.memoEdit1.Size = new Size(599, 101);
            this.memoEdit1.TabIndex = 0;
            this.memoEdit1.DoubleClick += new EventHandler(this.memoEdit1_DoubleClick);
            this.panelControl4.Controls.Add(this.kidQzxrya7);
            this.panelControl4.Controls.Add(this.textEdit2);
            this.panelControl4.Controls.Add(this.labelControl14);
            this.panelControl4.Controls.Add(this.labelControl12);
            this.panelControl4.Controls.Add(this.ceTYSB);
            this.panelControl4.Controls.Add(this.edtBGLRQ);
            this.panelControl4.Controls.Add(this.labelControl13);
            this.panelControl4.Controls.Add(this.textEdit7);
            this.panelControl4.Controls.Add(this.labelControl8);
            this.panelControl4.Controls.Add(this.textEdit6);
            this.panelControl4.Controls.Add(this.labelControl6);
            this.panelControl4.Controls.Add(this.textEdit1);
            this.panelControl4.Controls.Add(this.labelControl5);
            this.panelControl4.Controls.Add(this.textEdit5);
            this.panelControl4.Controls.Add(this.textEdit4);
            this.panelControl4.Controls.Add(this.textEdit3);
            this.panelControl4.Controls.Add(this.labelControl4);
            this.panelControl4.Controls.Add(this.labelControl3);
            this.panelControl4.Controls.Add(this.XDSLSFKWM);
            this.panelControl4.Controls.Add(this.labelControl1);
            this.panelControl4.Controls.Add(this.edtBGLH);
            this.panelControl4.Dock = DockStyle.Top;
            this.panelControl4.Location = new Point(121, 2);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(603, 147);
            this.panelControl4.TabIndex = 14;
            this.kidQzxrya7.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BW", true));
            this.kidQzxrya7.Location = new Point(308, 120);
            this.kidQzxrya7.Name = "textEdit12";
            this.kidQzxrya7.Size = new Size(276, 21);
            this.kidQzxrya7.TabIndex = 28;
            this.textEdit2.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "QQZH", true));
            this.textEdit2.Location = new Point(79, 120);
            this.textEdit2.Name = "textEdit2";
            this.textEdit2.Size = new Size(167, 21);
            this.textEdit2.TabIndex = 27;
            this.labelControl14.Location = new Point(278, 123);
            this.labelControl14.Name = "labelControl14";
            this.labelControl14.Size = new Size(24, 14);
            this.labelControl14.TabIndex = 26;
            this.labelControl14.Text = "部位";
            this.labelControl12.Location = new Point(25, 123);
            this.labelControl12.Name = "labelControl12";
            this.labelControl12.Size = new Size(48, 14);
            this.labelControl12.TabIndex = 25;
            this.labelControl12.Text = "起讫桩号";
            this.ceTYSB.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "TYSB", true));
            this.ceTYSB.EditValue = 0;
            this.ceTYSB.Location = new Point(6, 5);
            this.ceTYSB.Name = "ceTYSB";
            this.ceTYSB.Properties.Caption = "同意下达";
            this.ceTYSB.Properties.DisplayValueChecked = "1";
            this.ceTYSB.Properties.DisplayValueUnchecked = "0";
            this.ceTYSB.Properties.EditValueChangedFiringMode = EditValueChangedFiringMode.Buffered;
            this.ceTYSB.Properties.NullStyle = StyleIndeterminate.Unchecked;
            this.ceTYSB.Properties.ValueChecked = 1;
            this.ceTYSB.Properties.ValueUnchecked = 0;
            this.ceTYSB.Size = new Size(72, 19);
            this.ceTYSB.TabIndex = 24;
            this.ceTYSB.Tag = "-1";
            this.ceTYSB.EditValueChanging += new ChangingEventHandler(this.ceTYSB_EditValueChanging);
            this.edtBGLRQ.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGLRQ", true));
            this.edtBGLRQ.EditValue = null;
            this.edtBGLRQ.Location = new Point(79, 27);
            this.edtBGLRQ.Name = "edtBGLRQ";
            this.edtBGLRQ.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.edtBGLRQ.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.edtBGLRQ.Size = new Size(100, 21);
            this.edtBGLRQ.TabIndex = 23;
            this.labelControl13.Location = new Point(25, 30);
            this.labelControl13.Name = "labelControl13";
            this.labelControl13.Size = new Size(48, 14);
            this.labelControl13.TabIndex = 22;
            this.labelControl13.Text = "签发日期";
            this.textEdit7.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGTM", true));
            this.textEdit7.Location = new Point(308, 97);
            this.textEdit7.Name = "textEdit7";
            this.textEdit7.Size = new Size(276, 21);
            this.textEdit7.TabIndex = 19;
            this.labelControl8.Location = new Point(254, 100);
            this.labelControl8.Name = "labelControl8";
            this.labelControl8.Size = new Size(48, 14);
            this.labelControl8.TabIndex = 18;
            this.labelControl8.Text = "变更图名";
            this.textEdit6.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGTH", true));
            this.textEdit6.Location = new Point(79, 97);
            this.textEdit6.Name = "textEdit6";
            this.textEdit6.Size = new Size(167, 21);
            this.textEdit6.TabIndex = 17;
            this.labelControl6.Location = new Point(25, 100);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new Size(48, 14);
            this.labelControl6.TabIndex = 16;
            this.labelControl6.Text = "变更图号";
            this.textEdit1.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGZJE", true));
            this.textEdit1.Location = new Point(490, 27);
            this.textEdit1.Name = "textEdit1";
            this.textEdit1.Properties.DisplayFormat.FormatString = "0";
            this.textEdit1.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.textEdit1.Properties.EditFormat.FormatString = "0";
            this.textEdit1.Properties.EditFormat.FormatType = FormatType.Numeric;
            this.textEdit1.Properties.ReadOnly = true;
            this.textEdit1.Size = new Size(94, 21);
            this.textEdit1.TabIndex = 15;
            this.textEdit1.Tag = "-3";
            this.labelControl5.Location = new Point(424, 30);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(60, 14);
            this.labelControl5.TabIndex = 14;
            this.labelControl5.Text = "变更总金额";
            this.textEdit5.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "YTM", true));
            this.textEdit5.Location = new Point(308, 74);
            this.textEdit5.Name = "textEdit5";
            this.textEdit5.Size = new Size(276, 21);
            this.textEdit5.TabIndex = 10;
            this.textEdit4.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "YTH", true));
            this.textEdit4.Location = new Point(79, 74);
            this.textEdit4.Name = "textEdit4";
            this.textEdit4.Size = new Size(167, 21);
            this.textEdit4.TabIndex = 9;
            this.textEdit3.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGLQDMC", true));
            this.textEdit3.Location = new Point(79, 51);
            this.textEdit3.Name = "textEdit3";
            this.textEdit3.Size = new Size(505, 21);
            this.textEdit3.TabIndex = 8;
            this.labelControl4.Location = new Point(266, 77);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(36, 14);
            this.labelControl4.TabIndex = 4;
            this.labelControl4.Text = "原图名";
            this.labelControl3.Location = new Point(37, 77);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(36, 14);
            this.labelControl3.TabIndex = 3;
            this.labelControl3.Text = "原图号";
            this.XDSLSFKWM.Location = new Point(13, 54);
            this.XDSLSFKWM.Name = "labelControl2";
            this.XDSLSFKWM.Size = new Size(60, 14);
            this.XDSLSFKWM.TabIndex = 2;
            this.XDSLSFKWM.Text = "变更令名称";
            this.labelControl1.Location = new Point(197, 30);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(52, 14);
            this.labelControl1.TabIndex = 1;
            this.labelControl1.Text = "变更令号 ";
            this.edtBGLH.DataBindings.Add(new Binding("EditValue", this.bindingSource2, "BGLH", true));
            this.edtBGLH.Location = new Point(254, 27);
            this.edtBGLH.Name = "edtBGLH";
            this.edtBGLH.Size = new Size(132, 21);
            this.edtBGLH.TabIndex = 0;
            this.panelControl3.Controls.Add(this.btnSDBZ);
            this.panelControl3.Controls.Add(this.btnDel);
            this.panelControl3.Controls.Add(this.btnCopy);
            this.panelControl3.Controls.Add(this.btnNew);
            this.panelControl3.Controls.Add(this.buttonEdit);
            this.panelControl3.Controls.Add(this.btnExport);
            this.panelControl3.Dock = DockStyle.Top;
            this.panelControl3.Location = new Point(308, 0);
            this.panelControl3.Name = "panelControl3";
            this.panelControl3.Padding = new Padding(3);
            this.panelControl3.Size = new Size(964, 32);
            this.panelControl3.TabIndex = 12;
            this.btnExport.Dock = DockStyle.Right;
            this.btnExport.Location = new Point(891, 5);
            this.btnExport.Name = "btnExport";
            this.btnExport.Size = new Size(68, 22);
            this.btnExport.TabIndex = 12;
            this.btnExport.Tag = "-3";
            this.btnExport.Text = "下达变更令";
            this.btnExport.Click += new EventHandler(this.btnExport_Click);
            this.btnSDBZ.Dock = DockStyle.Right;
            this.btnSDBZ.Location = new Point(818, 5);
            this.btnSDBZ.Name = "btnSDBZ";
            this.btnSDBZ.Size = new Size(73, 22);
            this.btnSDBZ.TabIndex = 11;
            this.btnSDBZ.Tag = "-3";
            this.btnSDBZ.Text = "变更令解锁";
            this.btnSDBZ.Visible = false;
            this.btnSDBZ.Click += new EventHandler(this.btnSDBZ_Click);
            this.btnDel.Dock = DockStyle.Left;
            this.btnDel.Location = new Point(318, 5);
            this.btnDel.Name = "btnDel";
            this.btnDel.Size = new Size(50, 22);
            this.btnDel.TabIndex = 7;
            this.btnDel.Tag = "-1";
            this.btnDel.Text = "删除";
            this.btnDel.Click += new EventHandler(this.btnDel_Click);
            this.btnCopy.Dock = DockStyle.Left;
            this.btnCopy.Location = new Point(268, 5);
            this.btnCopy.Name = "btnCopy";
            this.btnCopy.Size = new Size(50, 22);
            this.btnCopy.TabIndex = 9;
            this.btnCopy.Tag = "-1";
            this.btnCopy.Text = "复制";
            this.btnCopy.Click += new EventHandler(this.btnCopy_Click);
            this.btnNew.Dock = DockStyle.Left;
            this.btnNew.Location = new Point(218, 5);
            this.btnNew.Name = "btnNew";
            this.btnNew.Size = new Size(50, 22);
            this.btnNew.TabIndex = 3;
            this.btnNew.Tag = "-1";
            this.btnNew.Text = "新建";
            this.btnNew.Click += new EventHandler(this.btnNew_Click);
            this.buttonEdit.Dock = DockStyle.Left;
            this.buttonEdit.Location = new Point(5, 5);
            this.buttonEdit.Name = "btnSearchPJ";
            this.buttonEdit.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Close) });
            this.buttonEdit.Size = new Size(213, 21);
            this.buttonEdit.TabIndex = 10;
            this.buttonEdit.Tag = "-3";
            this.buttonEdit.ButtonClick += new ButtonPressedEventHandler(this.buttonEdit_ButtonClick);
            this.buttonEdit.KeyPress += new KeyPressEventHandler(this.buttonEdit_KeyPress);
            this.bindingSource3.DataMember = "JLQD";
            this.bindingSource3.DataSource = base.dataSets;
            this.panelControl6.Location = new Point(844, 106);
            this.panelControl6.Name = "panelControl6";
            this.panelControl6.Size = new Size(188, 526);
            this.panelControl6.TabIndex = 18;
            this.panelControl5.Controls.Add(this.gridControl);
            this.panelControl5.Controls.Add(this.splitterControl3);
            this.panelControl5.Controls.Add(this.groupControl1);
            this.panelControl5.Controls.Add(this.panelControl4);
            this.panelControl5.Controls.Add(this.splitterControl2);
            this.panelControl5.Controls.Add(this.groupControl2);
            this.panelControl5.Controls.Add(this.splitterControl1);
            this.panelControl5.Controls.Add(this.gridControl2);
            this.panelControl5.Dock = DockStyle.Fill;
            this.panelControl5.Location = new Point(308, 32);
            this.panelControl5.Name = "panelControl5";
            this.panelControl5.Size = new Size(964, 524);
            this.panelControl5.TabIndex = 17;
            this.splitterControl3.Dock = DockStyle.Top;
            this.splitterControl3.Location = new Point(121, 275);
            this.splitterControl3.Name = "splitterControl3";
            this.splitterControl3.Size = new Size(603, 6);
            this.splitterControl3.TabIndex = 20;
            this.splitterControl3.TabStop = false;
            this.splitterControl2.Dock = DockStyle.Right;
            this.splitterControl2.Location = new Point(724, 2);
            this.splitterControl2.Name = "splitterControl2";
            this.splitterControl2.Size = new Size(6, 520);
            this.splitterControl2.TabIndex = 19;
            this.splitterControl2.TabStop = false;
            this.groupControl2.Controls.Add(this.gridControl1);
            this.groupControl2.Controls.Add(this.panelControl1);
            this.groupControl2.Dock = DockStyle.Right;
            this.groupControl2.Location = new Point(730, 2);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(232, 520);
            this.groupControl2.TabIndex = 16;
            this.groupControl2.Text = "清单变更情况";
            this.gridControl1.DataSource = this.bindingSource;
            this.gridControl1.Dock = DockStyle.Fill;
            this.gridControl1.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl1.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl1.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl1.Location = new Point(2, 123);
            this.gridControl1.MainView = this.gridView1;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.Size = new Size(228, 395);
            this.gridControl1.TabIndex = 15;
            this.gridControl1.ViewCollection.AddRange(new BaseView[] { this.gridView1 });
            this.gridView1.Columns.AddRange(new GridColumn[] { this.colMC, this.gridColumn5, this.colbl });
            this.gridView1.GridControl = this.gridControl1;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsCustomization.AllowFilter = false;
            this.gridView1.OptionsCustomization.AllowGroup = false;
            this.gridView1.OptionsCustomization.AllowSort = false;
            this.gridView1.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.OptionsView.ShowIndicator = false;
            this.colMC.Caption = "变更令号";
            this.colMC.FieldName = "mc";
            this.colMC.Name = "colMC";
            this.colMC.Visible = true;
            this.colMC.VisibleIndex = 0;
            this.colMC.Width = 111;
            this.gridColumn5.Caption = "增减数";
            this.gridColumn5.DisplayFormat.FormatString = "0.000";
            this.gridColumn5.DisplayFormat.FormatType = FormatType.Numeric;
            this.gridColumn5.FieldName = "bgzjl";
            this.gridColumn5.Name = "colbgzjl11";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 1;
            this.gridColumn5.Width = 65;
            this.colbl.Caption = "比率%";
            this.colbl.FieldName = "bl";
            this.colbl.Name = "colbl";
            this.colbl.Visible = true;
            this.colbl.VisibleIndex = 2;
            this.colbl.Width = 47;
            this.panelControl1.Controls.Add(this.labelControl11);
            this.panelControl1.Controls.Add(this.textEdit);
            this.panelControl1.Controls.Add(this.labelControl10);
            this.panelControl1.Controls.Add(this.textEdit10);
            this.panelControl1.Controls.Add(this.labelControl9);
            this.panelControl1.Controls.Add(this.labelControl7);
            this.panelControl1.Controls.Add(this.textEdit9);
            this.panelControl1.Controls.Add(this.textEdit8);
            this.panelControl1.Dock = DockStyle.Top;
            this.panelControl1.Location = new Point(2, 23);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(228, 100);
            this.panelControl1.TabIndex = 16;
            this.panelControl1.Tag = "-3";
            this.labelControl11.Location = new Point(101, 47);
            this.labelControl11.Name = "labelControl11";
            this.labelControl11.Size = new Size(60, 14);
            this.labelControl11.TabIndex = 7;
            this.labelControl11.Text = "原合同数量";
            this.textEdit.DataBindings.Add(new Binding("EditValue", this.bindingSource, "htsl", true));
            this.textEdit.Location = new Point(100, 63);
            this.textEdit.Name = "textEdit11";
            this.textEdit.Properties.DisplayFormat.FormatString = "0.000";
            this.textEdit.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            this.textEdit.Properties.ReadOnly = true;
            this.textEdit.Size = new Size(121, 21);
            this.textEdit.TabIndex = 6;
            this.textEdit.Tag = "-3";
            this.labelControl10.Location = new Point(7, 47);
            this.labelControl10.Name = "labelControl10";
            this.labelControl10.Size = new Size(24, 14);
            this.labelControl10.TabIndex = 5;
            this.labelControl10.Text = "单位";
            this.textEdit10.DataBindings.Add(new Binding("EditValue", this.bindingSource, "dw", true));
            this.textEdit10.Location = new Point(6, 63);
            this.textEdit10.Name = "textEdit10";
            this.textEdit10.Properties.ReadOnly = true;
            this.textEdit10.Size = new Size(88, 21);
            this.textEdit10.TabIndex = 4;
            this.textEdit10.Tag = "-3";
            this.labelControl9.Location = new Point(99, 5);
            this.labelControl9.Name = "labelControl9";
            this.labelControl9.Size = new Size(48, 14);
            this.labelControl9.TabIndex = 3;
            this.labelControl9.Text = "清单名称";
            this.labelControl7.Location = new Point(6, 6);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new Size(48, 14);
            this.labelControl7.TabIndex = 2;
            this.labelControl7.Text = "清单编号";
            this.textEdit9.DataBindings.Add(new Binding("EditValue", this.bindingSource, "qdmc", true));
            this.textEdit9.Location = new Point(99, 22);
            this.textEdit9.Name = "textEdit9";
            this.textEdit9.Properties.ReadOnly = true;
            this.textEdit9.Size = new Size(122, 21);
            this.textEdit9.TabIndex = 1;
            this.textEdit9.Tag = "-3";
            this.textEdit8.DataBindings.Add(new Binding("EditValue", this.bindingSource, "qdbh", true));
            this.textEdit8.Location = new Point(5, 22);
            this.textEdit8.Name = "textEdit8";
            this.textEdit8.Properties.ReadOnly = true;
            this.textEdit8.Size = new Size(88, 21);
            this.textEdit8.TabIndex = 0;
            this.textEdit8.Tag = "-3";
            this.splitterControl1.Location = new Point(115, 2);
            this.splitterControl1.Name = "splitterControl1";
            this.splitterControl1.Size = new Size(6, 520);
            this.splitterControl1.TabIndex = 17;
            this.splitterControl1.TabStop = false;
            this.gridControl2.DataSource = this.bindingSource2;
            this.gridControl2.Dock = DockStyle.Left;
            this.gridControl2.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl2.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl2.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            node.RelationName = "Level1";
            this.gridControl2.LevelTree.Nodes.AddRange(new GridLevelNode[] { node });
            this.gridControl2.Location = new Point(2, 2);
            this.gridControl2.MainView = this.gridView3;
            this.gridControl2.Name = "gridControl2";
            this.gridControl2.Size = new Size(113, 520);
            this.gridControl2.TabIndex = 22;
            this.gridControl2.ViewCollection.AddRange(new BaseView[] { this.gridView3 });
            this.gridView3.Columns.AddRange(new GridColumn[] { this.gridColumn1 });
            this.gridView3.GridControl = this.gridControl2;
            this.gridView3.Name = "gridView3";
            this.gridView3.OptionsCustomization.AllowFilter = false;
            this.gridView3.OptionsCustomization.AllowGroup = false;
            this.gridView3.OptionsCustomization.AllowSort = false;
            this.gridView3.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView3.OptionsView.ColumnAutoWidth = false;
            this.gridView3.OptionsView.ShowGroupPanel = false;
            this.gridView3.OptionsView.ShowIndicator = false;
            this.gridColumn1.Caption = "变更令号";
            this.gridColumn1.FieldName = "BGLH";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.OptionsColumn.AllowEdit = false;
            this.gridColumn1.OptionsColumn.ReadOnly = true;
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn1.Width = 103;
            this.dockManager.Form = this;
            this.dockManager.RootPanels.AddRange(new DockPanel[] { this.dockPanel1 });
            this.dockManager.TopZIndexControls.AddRange(new string[] { "DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.StatusBar", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl" });
            this.dockPanel1.Controls.Add(this.dockPanel1_Container);
            this.dockPanel1.Dock = DockingStyle.Left;
            this.dockPanel1.ID = new Guid("edc4e822-91da-4f5a-9e6f-def868eb6cca");
            this.dockPanel1.Location = new Point(0, 0);
            this.dockPanel1.Name = "dockPanel1";
            this.dockPanel1.Options.ShowCloseButton = false;
            this.dockPanel1.OriginalSize = new Size(308, 200);
            this.dockPanel1.Size = new Size(308, 556);
            this.dockPanel1.Text = "清单信息";
            this.dockPanel1_Container.Controls.Add(this.xtraTabControl);
            this.dockPanel1_Container.Controls.Add(this.panelControl7);
            this.dockPanel1_Container.Location = new Point(3, 25);
            this.dockPanel1_Container.Name = "dockPanel1_Container";
            this.dockPanel1_Container.Size = new Size(302, 528);
            this.dockPanel1_Container.TabIndex = 0;
            this.xtraTabControl.Dock = DockStyle.Fill;
            this.xtraTabControl.Location = new Point(0, 32);
            this.xtraTabControl.Name = "tbcQDList";
            this.xtraTabControl.SelectedTabPage = this.xtraTabPage1;
            this.xtraTabControl.Size = new Size(302, 496);
            this.xtraTabControl.TabIndex = 25;
            this.xtraTabControl.TabPages.AddRange(new XtraTabPage[] { this.xtraTabPage1, this.xtraTabPage2 });
            this.xtraTabControl.SelectedPageChanged += new TabPageChangedEventHandler(this.xtraTabControl_SelectedPageChanged);
            this.xtraTabPage1.Controls.Add(this.gridControl3);
            this.xtraTabPage1.Name = "xtraTabPage1";
            this.xtraTabPage1.Size = new Size(295, 466);
            this.xtraTabPage1.Text = "变更令清单";
            this.gridControl3.DataSource = this.bindingSource4;
            this.gridControl3.Dock = DockStyle.Fill;
            this.gridControl3.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl3.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gridControl3.Location = new Point(0, 0);
            this.gridControl3.MainView = this.gridView4;
            this.gridControl3.Name = "gridControl3";
            this.gridControl3.Size = new Size(295, 466);
            this.gridControl3.TabIndex = 15;
            this.gridControl3.ViewCollection.AddRange(new BaseView[] { this.gridView4 });
            this.gridControl3.DoubleClick += new EventHandler(this.gridControl3_DoubleClick);
            this.bindingSource4.DataMember = "JLQD";
            this.bindingSource4.DataSource = base.dataSets;
            this.gridView4.Columns.AddRange(new GridColumn[] { this.gridColumn2, this.gridColumn3 });
            this.gridView4.GridControl = this.gridControl3;
            this.gridView4.Name = "gridView4";
            this.gridView4.OptionsCustomization.AllowFilter = false;
            this.gridView4.OptionsCustomization.AllowGroup = false;
            this.gridView4.OptionsCustomization.AllowSort = false;
            this.gridView4.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView4.OptionsView.ColumnAutoWidth = false;
            this.gridView4.OptionsView.ShowGroupPanel = false;
            this.gridView4.OptionsView.ShowIndicator = false;
            this.gridColumn2.Caption = "清单编号";
            this.gridColumn2.FieldName = "QDBH";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.OptionsColumn.AllowEdit = false;
            this.gridColumn2.OptionsColumn.ReadOnly = true;
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 0;
            this.gridColumn2.Width = 68;
            this.gridColumn3.Caption = "项目名称";
            this.gridColumn3.FieldName = "QDMC";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.OptionsColumn.AllowEdit = false;
            this.gridColumn3.OptionsColumn.ReadOnly = true;
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 1;
            this.gridColumn3.Width = 200;
            this.xtraTabPage2.Controls.Add(this.trJLQD);
            this.xtraTabPage2.Name = "xtraTabPage2";
            this.xtraTabPage2.Size = new Size(295, 466);
            this.xtraTabPage2.Text = "合同清单";
            this.trJLQD.Columns.AddRange(new TreeListColumn[] { this.colQDBH1, this.colCBMC, this.colID });
            this.trJLQD.DataSource = this.bindingSource3;
            this.trJLQD.Dock = DockStyle.Fill;
            this.trJLQD.ImageIndexFieldName = "QDLX";
            this.trJLQD.Location = new Point(0, 0);
            this.trJLQD.Name = "trJLQD";
            this.trJLQD.OptionsBehavior.Editable = false;
            this.trJLQD.OptionsView.AutoWidth = false;
            this.trJLQD.OptionsView.ShowIndicator = false;
            this.trJLQD.ParentFieldName = "PID";
            this.trJLQD.PreviewFieldName = "QDMC";
            this.trJLQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox2 });
            this.trJLQD.Size = new Size(295, 466);
            this.trJLQD.TabIndex = 16;
            this.trJLQD.TreeLevelWidth = 12;
            this.trJLQD.TreeLineStyle = LineStyle.None;
            this.trJLQD.DoubleClick += new EventHandler(this.trJLQD_DoubleClick);
            this.colQDBH1.Caption = "清单编号";
            this.colQDBH1.FieldName = "QDBH";
            this.colQDBH1.Name = "colQDBH1";
            this.colQDBH1.OptionsColumn.AllowSort = false;
            this.colQDBH1.Visible = true;
            this.colQDBH1.VisibleIndex = 0;
            this.colQDBH1.Width = 58;
            this.colCBMC.Caption = "清单";
            this.colCBMC.FieldName = "QDMC";
            this.colCBMC.Name = "colCBMC";
            this.colCBMC.OptionsColumn.AllowSort = false;
            this.colCBMC.Visible = true;
            this.colCBMC.VisibleIndex = 1;
            this.colCBMC.Width = 233;
            this.colID.FieldName = "ID";
            this.colID.Name = "colID";
            this.repositoryItemImageComboBox2.AutoHeight = false;
            this.repositoryItemImageComboBox2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox2.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("", "1", 1), new ImageComboBoxItem("", "2", 5), new ImageComboBoxItem("", "3", 11) });
            this.repositoryItemImageComboBox2.Name = "repositoryItemImageComboBox2";
            this.panelControl7.Controls.Add(this.radioGroup);
            this.panelControl7.Controls.Add(this.simpleButton);
            this.panelControl7.Dock = DockStyle.Top;
            this.panelControl7.Location = new Point(0, 0);
            this.panelControl7.Name = "panelControl7";
            this.panelControl7.Size = new Size(302, 32);
            this.panelControl7.TabIndex = 17;
            this.radioGroup.Dock = DockStyle.Fill;
            this.radioGroup.Location = new Point(2, 2);
            this.radioGroup.Name = "radQDSelc";
            this.radioGroup.Properties.Columns = 2;
            this.radioGroup.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "变更令清单"), new RadioGroupItem(null, "合同清单") });
            this.radioGroup.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.radioGroup.Size = new Size(223, 28);
            this.radioGroup.TabIndex = 20;
            this.radioGroup.SelectedIndexChanged += new EventHandler(this.radioGroup_SelectedIndexChanged);
            this.simpleButton.Dock = DockStyle.Right;
            this.simpleButton.Location = new Point(225, 2);
            this.simpleButton.Name = "btnEditQD";
            this.simpleButton.Size = new Size(75, 28);
            this.simpleButton.TabIndex = 0;
            this.simpleButton.Tag = "-3";
            this.simpleButton.Text = "新增清单";
            this.simpleButton.Click += new EventHandler(this.simpleButton_Click);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(1272, 556);
            base.Controls.Add(this.panelControl5);
            base.Controls.Add(this.panelControl6);
            base.Controls.Add(this.panelControl3);
            base.Controls.Add(this.dockPanel1);
            base.Name = "FrmBGL";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "变更令";
            base.WindowState = FormWindowState.Maximized;
            base.Load += new EventHandler(this.FrmBGL_Load);
            base.ds.EndInit();
            base.dsQuery.EndInit();
            base.dataSets.EndInit();
            ((ISupportInitialize)this.bindingSource).EndInit();
            ((ISupportInitialize)this.bindingSource2).EndInit();
            ((ISupportInitialize)this.bindingSource1).EndInit();
            this.gridControl.EndInit();
            this.gridView2.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.memoEdit1.Properties.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            this.panelControl4.PerformLayout();
            this.kidQzxrya7.Properties.EndInit();
            this.textEdit2.Properties.EndInit();
            this.ceTYSB.Properties.EndInit();
            this.edtBGLRQ.Properties.VistaTimeProperties.EndInit();
            this.edtBGLRQ.Properties.EndInit();
            this.textEdit7.Properties.EndInit();
            this.textEdit6.Properties.EndInit();
            this.textEdit1.Properties.EndInit();
            this.textEdit5.Properties.EndInit();
            this.textEdit4.Properties.EndInit();
            this.textEdit3.Properties.EndInit();
            this.edtBGLH.Properties.EndInit();
            this.panelControl3.EndInit();
            this.panelControl3.ResumeLayout(false);
            this.buttonEdit.Properties.EndInit();
            ((ISupportInitialize)this.bindingSource3).EndInit();
            this.panelControl6.EndInit();
            this.panelControl5.EndInit();
            this.panelControl5.ResumeLayout(false);
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.gridControl1.EndInit();
            this.gridView1.EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.panelControl1.PerformLayout();
            this.textEdit.Properties.EndInit();
            this.textEdit10.Properties.EndInit();
            this.textEdit9.Properties.EndInit();
            this.textEdit8.Properties.EndInit();
            this.gridControl2.EndInit();
            this.gridView3.EndInit();
            this.dockManager.EndInit();
            this.dockPanel1.ResumeLayout(false);
            this.dockPanel1_Container.ResumeLayout(false);
            this.xtraTabControl.EndInit();
            this.xtraTabControl.ResumeLayout(false);
            this.xtraTabPage1.ResumeLayout(false);
            this.gridControl3.EndInit();
            ((ISupportInitialize)this.bindingSource4).EndInit();
            this.gridView4.EndInit();
            this.xtraTabPage2.ResumeLayout(false);
            this.trJLQD.EndInit();
            this.repositoryItemImageComboBox2.EndInit();
            this.panelControl7.EndInit();
            this.panelControl7.ResumeLayout(false);
            this.radioGroup.Properties.EndInit();
            base.ResumeLayout(false);
        }

        public override void LoadedForm()
        {
            base.SetBindingSource(this.bindingSource2, "BGL", true);
            this.ds.Tables["BGL"].TableNewRow += new DataTableNewRowEventHandler(this.method2);
            base.SetBindingSource(this.bindingSource1, "BGLQD", false);
            this.bindingSource3.DataSource = this.dsQuery.Tables["JLQD"];
            this.bindingSource2.PositionChanged += new EventHandler(this.bindingSource2_PositionChanged);
            this.bindingSource4.DataSource = this.dsQuery.Tables["GBLQDList"];
            this.ds.Tables["BGLQD"].ColumnChanging += new DataColumnChangeEventHandler(this.method14);
            this.ds.Tables["BGLQD"].ColumnChanged += new DataColumnChangeEventHandler(this.method3);
            this.bindingSource.DataSource = this.dsQuery.Tables["BGLList"];
            this.bindingSource.Sort = "bgtype";
            base.LoadedForm();
            this.method8(null);
            this.method6(false);
            this.lquywmUul(DHelp.GetDataRow(this.bindingSource2));
        }

        public override void LoadingData()
        {
            this.ds.Clear();
            this.dsQuery.Clear();
            base.LoadingData();
            this.ds.Merge(this.ida.ExecuteDataSet(string.Concat("select * from BGL", Class28.smethod1(), " order by bglxh"), CommandType.Text, "BGL"));
            string str = string.Concat("select * from BGLQD", Class28.smethod1());
            this.ds.Merge(this.ida.ExecuteDataSet(str, CommandType.Text, "BGLQD"));
            this.method5();
            this.method4();
            this.method6(false);
        }

        private void lquywmUul(DataRow dataRow)
        {
            bool flag = false;
            flag = (dataRow == null ? false : dataRow["SDBZ"].Equals(1));
            if (this.btnSDBZ.Enabled != flag)
            {
                this.btnSDBZ.Enabled = flag;
            }
        }

        private void memoEdit1_DoubleClick(object sender, EventArgs e)
        {
        }

        private void method1()
        {
            this.bindingSource2.PositionChanged -= new EventHandler(this.bindingSource2_PositionChanged);
            this.bindingSource2.PositionChanged -= new EventHandler(this.PositionChanged);
            this.ds.Tables["BGL"].Clear();
            this.ds.Merge(this.ida.ExecuteDataSet(string.Concat("select * from BGL", Class28.smethod1(), " order by bglxh"), CommandType.Text, "BGL"));
            this.bindingSource2.PositionChanged += new EventHandler(this.PositionChanged);
            this.bindingSource2.PositionChanged += new EventHandler(this.bindingSource2_PositionChanged);
            this.method4();
            this.method6(false);
        }

        private void method10(object sender, EventArgs e)
        {
            base.Close();
        }

        private void method11()
        {
            if (!this.edtBGLH.Properties.ReadOnly)
            {
                DataRow dataRow = null;
                dataRow = DHelp.GetDataRow(this.bindingSource3);
                string str = dataRow["qdbh"].ToString();
                int num = this.bindingSource1.Find("qdbh", str);
                if (num != -1)
                {
                    this.bindingSource1.Position = num;
                }
                else
                {
                    DataTable item = this.ds.Tables["BGLQD"];
                    DataRow objId = item.NewRow();
                    objId["PID"] = DHelp.GetObjId(this.bindingSource2);
                    objId["QDID"] = dataRow["ID"];
                    objId["QDBH"] = dataRow["QDBH"];
                    objId["QDMC"] = dataRow["QDMC"];
                    objId["DJ"] = dataRow["ZBDJ"];
                    objId["HTSL"] = dataRow["HTSL"];
                    objId.EndEdit();
                    item.Rows.Add(objId);
                    this.bindingSource1.Position = this.bindingSource1.List.Count;
                }
                base.Save();
                this.method6(true);
            }
        }

        private void method12()
        {
            if (this.bindingSource2.List.Count > 0 && MsgBox.ShowQuestion("是否删除当前计量？") == DialogResult.OK)
            {
                while (this.bindingSource1.List.Count > 0)
                {
                    this.bindingSource1.RemoveCurrent();
                }
                this.bindingSource2.RemoveCurrent();
            }
        }

        private void method13()
        {
            if (!this.edtBGLH.Properties.ReadOnly && this.bindingSource1.List.Count > 0 && MsgBox.ShowQuestion("是否删除当前记录？") == DialogResult.OK)
            {
                this.bindingSource1.RemoveCurrent();
                base.Save();
            }
        }

        private void method14(object sender, DataColumnChangeEventArgs e)
        {
            decimal num;
            if (!(e.Column.ColumnName.Equals("BBWYTZSL") ? false : !e.Column.ColumnName.Equals("BBWBGHTZSL")))
            {
                decimal num1 = new decimal(0);
                decimal num2 = new decimal(0);
                num = new decimal(0);
                decimal num3 = CHelp.ConvertDecimal(e.Row["dj"], 0, 2);
                if (!e.Column.ColumnName.Equals("BBWYTZSL"))
                {
                    num1 = CHelp.ConvertDecimal(e.Row["BBWYTZSL"], 0, 3);
                    num2 = CHelp.ConvertDecimal(e.ProposedValue, 0, 3);
                }
                else
                {
                    num1 = CHelp.ConvertDecimal(e.ProposedValue, 0, 3);
                    num2 = CHelp.ConvertDecimal(e.Row["BBWBGHTZSL"], 0, 3);
                }
                num = num2 - num1;
                e.Row["BGZJL"] = num;
                e.Row["BGZJJE"] = num * num3;
            }
            else if (e.Column.ColumnName.Equals("BGZJL"))
            {
                decimal num4 = CHelp.ConvertDecimal(e.ProposedValue, 0, 3) - CHelp.ConvertDecimal(e.Row["BGZJL"], 0, 3);
                num = new decimal(0);
                decimal num5 = new decimal(1);
                this.bindingSource.Position = this.bindingSource.Find("bgtype", 2);
                DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
                if (dataRow != null)
                {
                    num = CHelp.ConvertDecimal(dataRow["bgzjl"], 0, 3) + num4;
                    num5 = CHelp.ConvertDecimal(dataRow["htsl"], 1, 3);
                    dataRow["bgzjl"] = num;
                    dataRow["bl"] = CHelp.ConvertDecimal((num / num5) * new decimal(100), -1, 2);
                    dataRow.EndEdit();
                    this.bindingSource.Position = this.bindingSource.Find("bgtype", 3);
                    dataRow = DHelp.GetDataRow(this.bindingSource);
                    num = CHelp.ConvertDecimal(dataRow["bgzjl"], 0, 3) + num4;
                    dataRow["bgzjl"] = num;
                    dataRow["bl"] = CHelp.ConvertDecimal((num / num5) * new decimal(100), -1, 2);
                    dataRow.EndEdit();
                }
            }
        }

        private void method15()
        {
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource2);
            DataTable table = DHelp.GetDataView(this.bindingSource1).ToTable();
            this.method9();
            DataRow dataRow1 = DHelp.GetDataRow(this.bindingSource2);
            DHelp.CopyRow(dataRow, dataRow1, "", "#qcid#id#bglh#bglxh#");
            string str = dataRow1["id"].ToString();
            foreach (DataRowView defaultView in table.DefaultView)
            {
                DataRow row = defaultView.Row;
                DataTable item = this.ds.Tables["BGLQD"];
                DataRow dataRow2 = item.NewRow();
                DHelp.CopyRow(row, dataRow2, str, "#qcid#bgzjl#bgzjje#");
                item.Rows.Add(dataRow2);
            }
            this.method8(null);
            this.method6(false);
        }

        private void method16()
        {
            if (this.buttonEdit.Text.Equals(""))
            {
                this.bindingSource2.RemoveFilter();
            }
            else
            {
                string str = "select id from BGL where id in (\r\nselect pid from BGLQD where (qdbh like '%{1}%' or qdmc like '%{1}%') and bdid='{0}'\r\n) and bdid='{0}'";
                str = string.Format(str, GParams._BDID, this.buttonEdit.Text);
                DataTable dt = DBHelp.GetDt(this.ida, str, "temp");
                string ids = DHelp.GetIds(dt, "id", "");
                if (!ids.Equals("''"))
                {
                    this.bindingSource2.Filter = string.Concat("id in (", ids, ")");
                }
                else
                {
                    this.bindingSource2.Filter = "1=2";
                }
            }
            this.method8(null);
        }

        private void method17(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.Tag.Equals("Add"))
            {
                this.method11();
            }
            else if (e.Button.Tag.Equals("Del"))
            {
                this.method13();
            }
        }

        private void method2(object sender, DataTableNewRowEventArgs e)
        {
            e.Row["BGLXH"] = this._str2;
        }

        private void method3(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.ColumnName.Equals("BGZJJE"))
            {
                DataRow dataRow = DHelp.GetDataRow(this.bindingSource2);
                dataRow["BGZJE"] = this.ds.Tables["BGLQD"].DefaultView.ToTable().Compute("sum(BGZJJE)", "");
                dataRow.EndEdit();
            }
        }

        private void method4()
        {
            if (this.dsQuery.Tables["GBLQDList"] != null)
            {
                this.dsQuery.Tables["GBLQDList"].Clear();
            }
            string str = string.Format("select * from JLQD where qdbh in (select qdbh from BGLQD where bdid='{0}') and bdid='{0}'", GParams._BDID);
            this.dsQuery.Merge(this.ida.ExecuteDataSet(str, CommandType.Text, "GBLQDList"));
        }

        private void method5()
        {
            if (this.dsQuery.Tables["JLQD"] != null)
            {
                this.dsQuery.Tables["JLQD"].Clear();
            }
            this.dsQuery.Merge(this.ida.ExecuteDataSet(string.Concat("select * from JLQD", Class28.smethod1()), CommandType.Text, "JLQD"));
        }

        private void method6(bool _flag1 = false)
        {
            string objValue = DHelp.GetObjValue(this.bindingSource2, "BGLXH", false);
            if ((this._str2 == null || !this._str2.Equals(objValue) ? true : _flag1))
            {
                this._str2 = objValue;
                string bGLQCHZ = CSQL.BGLQCHZ;
                bGLQCHZ = bGLQCHZ.Replace("#bglxh#", objValue);
                bGLQCHZ = bGLQCHZ.Replace("#bdid#", GParams._BDID);
                if (this.dsQuery.Tables["BGLList"] != null)
                {
                    this.dsQuery.Tables["BGLList"].Clear();
                }
                this.dsQuery.Merge(this.ida.ExecuteDataSet(bGLQCHZ, CommandType.Text, "BGLList"));
            }
        }

        private void method7(object sender, EventArgs e)
        {
        }

        private void method8(DataRow dataRow = null)
        {
            string empty = string.Empty;
            empty = (dataRow == null ? DHelp.GetObjId(this.bindingSource2) : dataRow["id"].ToString());
            this.bindingSource1.Filter = string.Concat("pid='", empty, "'");
        }

        private void method9()
        {
            object obj = this.ds.Tables["BGL"].Compute("Max(BGLXH)", "");
            if (obj.ToString().Equals(""))
            {
                this._str2 = "0";
            }
            else
            {
                this._str2 = obj.ToString();
            }
            this._str2 = Convert.ToString(Convert.ToInt16(this._str2) + 1);
            DataRow longDateString = DHelp.DataAddNew(this.bindingSource2, "", "");
            longDateString["BGLH"] = string.Concat("变更令号", this._str2);
            longDateString["BGLRQ"] = DateTime.Now.ToLongDateString();
            longDateString["BGLXH"] = this._str2;
            longDateString.EndEdit();
            this.bindingSource2.MoveLast();
            this.edtBGLH.Focus();
        }

        private void radioGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.xtraTabControl.SelectedTabPageIndex = this.radioGroup.SelectedIndex;
        }

        private void simpleButton_Click(object sender, EventArgs e)
        {
            FrmQDWH frmQDWH = new FrmQDWH();
            frmQDWH.IniData(GParams._XMID, GParams._BDID, GParams._YJBFS);
            if (frmQDWH.ShowDialog().Equals(DialogResult.OK))
            {
                this.method5();
            }
        }

        private void trJLQD_DoubleClick(object sender, EventArgs e)
        {
            if (!this.trJLQD.FocusedNode.HasChildren)
            {
                this.method11();
            }
            else
            {
                MsgBox.ShowMsg("请选择清单子节点为后继续此操作");
            }
        }

        private void vroAaJyIa(object sender, EventArgs e)
        {
            this.method13();
        }

        private void xtraTabControl_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (this.xtraTabControl.SelectedTabPageIndex == 0)
            {
                base.Save();
                this.method4();
            }
        }
    }
}